﻿using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace EfCore.Migrations
{
    /// <inheritdoc />
    public partial class addAnimalTable : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "T_Animal",
                columns: table => new
                {
                    MainName = table.Column<string>(type: "nvarchar(64)", maxLength: 64, nullable: false, comment: "主键"),
                    AnimalSize = table.Column<int>(type: "int", nullable: false, comment: "大小"),
                    LegCount = table.Column<int>(type: "int", nullable: false, defaultValue: 2, comment: "腿数量")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_T_Animal", x => x.MainName);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "T_Animal");
        }
    }
}
